<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        //创建类
        class People {
            constructor(name, age) { //构造器 每次创建对象都会调用 没有自动添加  ;接受参数返回实例对象
                this.name = name;
                this.age = age;
            }
        }
        //创建对象 
        var xy = new People('xuying', 18); //字符串加引号
        console.log(xy);
    </script>
</body>

</html>